import { $post, $delete, $get, $put } from '../utils/request'

// 添加地址
export const CREATE_ADDRESS = params => {
  return $post('/store-api/address/createAddress', params)
}
// 删除地址
export const DELETE_ADDRESS = addressId => {
  return $delete(`/store-api/address/deleteAddress?addressId=${addressId}`)
}
// 查询地址单个信息
export const FIND_ADDRESS_INFO = addressId => {
  return $get(`/store-api/address/findAddressInfo?addressId=${addressId}`)
}
// 查询地址列表
export const FIND_ADDRESS_LIST = (customerId, pageNo) => {
  return $post(
    `/store-api/address/findAddressPage?customerId=${customerId}&pageNo=${pageNo}&pageSize=10`
  )
}
// 设置默认地址
export const SET_DEFAULT_ADDRESS = (customerId, addressId) => {
  return $put(
    `/store-api/address/setDefaultAddress?customerId=${customerId}&addressId=${addressId}`
  )
}
// 编辑地址
export const UPDATE_ADDRESS = params => {
  return $put('/store-api/address/updateAddress', params)
}
